/* 
 * File:   alg_primitives.h
 * Author: gustavo
 *
 * Created on March 15, 2012, 12:18 PM
 */

#ifndef ALG_PRIMITIVES_H
#define	ALG_PRIMITIVES_H

#ifdef	__cplusplus
extern "C" {
#endif

#include <util/types.h>

	// =========================================================================
	void __vinc(real k, int m, real * u, int incu, real * v, int incv);
	void __vpow(real k, int m, real * u, int incu, real * v, int incv);

	real __vdot(int m, real * u, int incu, real * v, int incv);
	real __vnorm(int m, real * u, int incu);
	void __vouter(int m, real * u, int incu, real * v, int incv, real * O, int sto);

	void __mprint(int rows, int cols, real * M, int stm);

	void __mset( int m, int n, real * A, int sta, real val);
	void __mscale( int m, int n, real * A, int sta, real k, real * M, int stm);
	void __mpow( int m, int n, real * A, int sta, real k, real * P, int stp);
	void __mult(int rows_a, int cols_a, real * A, int sta, int rows_b, int cols_b, real * B, int stb, real * M, int stm);
	int __householder(int m, real * u, int incu, real * H, int sth);
	void __qr_householder(int m, int n, real * A, int sta, real * Q, int stq, real * R, int str);

	//void svd(double *a, int m, int n, double *w, double *v);
	int svd(int m, int n, double *a, double *s, double *u, double *v);




#ifdef	__cplusplus
}
#endif

#endif	/* ALG_PRIMITIVES_H */

